WRANGLERS
Photo by Annie Spratt on Unsplash
I am issuing a call to action for countries, companies and institutions globally
to step-up and become champions for paid parental leave…
— UN Women Goodwill Ambassador Anne Hathaway
Investing in family friendly policies is good for families, businesses and economies. But for too many parents around the world, policies, such as paid parental leave, breastfeeding breaks, childcare and child grants, are not a reality. Family-friendly policies matter because they help children to get a better start in life and help parents to find the right balance between their commitments at work and at home. Yet even some of the world’s richest countries fail to offer comprehensive solutions to all families.
Let’s take a closer look at the situation.
url_root <- "https://raw.githubusercontent.com/UN-AVT/kamino-source/main/sources/0-shared/data/"
url_file <- "more-money-more-time/more-money-more-time.csv"
url <- paste0(url_root, url_file)
df <- read.csv(url, header = TRUE, stringsAsFactors = FALSE)
df
# Select only the needed
df_complete <- select(df, c("Country", "Paid_maternity_leave_avg_payment_rate_percent", "Paid_maternity_leave_in_months", "difference_from_OECD_average"))
# Make sure we don't factor empty strings
df_complete <- filter(df_complete, nchar(Country) > 0)
# Factor the string fields
df_complete$Country <- as.factor(df_complete$Country)
# Remove incomplete cases
df_complete <- df_complete[complete.cases(df_complete), ]
df_complete
# theme parameters
theme_opts <- theme(
text = element_text(family = "inconsolata"),
legend.position = "none",
legend.title = element_blank(),
#axis.text = element_blank(),
#axis.line = element_blank(),
#axis.ticks = element_blank(),
#axis.title = element_blank(),
#panel.grid = element_blank(),
panel.grid.major = element_line(linetype = "dotted"),
panel.grid.minor = element_blank(),
panel.background = element_rect(fill="white", colour="white"),
#panel.border = element_blank(),
plot.background = element_rect(fill="white", colour="white"),
plot.title = element_text(vjust = 5.0),
plot.subtitle = element_text(vjust = 5.0),
plot.margin = unit(c(0.5,0.5,0.5,0.5), "in")
)
rate_average <- mean(df_complete$Paid_maternity_leave_avg_payment_rate_percent)
leave_average <- mean(df_complete$Paid_maternity_leave_in_months)
v1 <- ggplot(df_complete) +
annotate("rect", xmin = 0, xmax = leave_average, ymin = rate_average, ymax = 110, fill = "#f5f2d2", alpha = 0.8) +
annotate("rect", xmin = leave_average, xmax = 14.5, ymin = rate_average, ymax = 110, fill = "#e4edcc", alpha = 0.8) +
annotate("rect", xmin = 0, xmax = leave_average, ymin = 0, ymax = rate_average, fill = "#eeddc2", alpha = 0.8) +
annotate("rect", xmin = leave_average, xmax = 14.5, ymin = 0, ymax = rate_average, fill = "#f5f2d2", alpha = 0.8) +
geom_point_interactive(aes(x = Paid_maternity_leave_in_months,
y = Paid_maternity_leave_avg_payment_rate_percent,
tooltip = paste0("Country: ", Country, "\n",
"Paid_maternity_leave_avg_payment_rate_percent: ", Paid_maternity_leave_avg_payment_rate_percent, "%\n",
"Payment_Rate: ", Paid_maternity_leave_in_months, "\n",
"difference_from_OECD_average: ", difference_from_OECD_average),
data_id = row.names(df_complete)),
color='#111111', size = 3.0, alpha = 1.0 ) +
geom_text_repel(aes(x = Paid_maternity_leave_in_months,
y = Paid_maternity_leave_avg_payment_rate_percent,
label = Country), family = 'inconsolata', size = 4, force = 0.5, nudge_x = 0.25, segment.size = 0.2, segment.color = "grey50", direction = "y", hjust = 0) +
scale_x_continuous(limits = c(0, 15), breaks = seq(0, 15, 2), labels = seq(0, 15, 2), expand = c(0,0)) +
scale_y_continuous(limits = c(0, 110), breaks = seq(0, 110, 20), labels = seq(0, 110, 20), expand = c(0,0)) +
coord_cartesian(clip = 'off') +
labs(x="Paid Maternity Leave in Months",
y="Payment Rate",
title = "Maternity Leave & Pay",
caption = "source: OECD, DataWrapper") +
theme_minimal(base_family = "inconsolata", base_size = 16) +
theme_opts
girafe(ggobj = v1, width_svg = 16, height_svg = 12,
options = list(
opts_sizing(rescale = TRUE, width = 1.0),
opts_hover_inv(css = "opacity:0.2;"),
opts_hover(css = "fill:black;")
)
)
v2 <- v1 + geom_hline(yintercept = rate_average, linetype = "dashed", color = "#bbbbbb") +
geom_vline(xintercept = leave_average, linetype = "dashed", color = "#bbbbbb") +
annotate("text", x = leave_average, y = 110,
label = "OECD Leave Avg",
hjust = 0.5, vjust = -1.0, size = 5, color = "#aaaaaa", family = "inconsolata", fontface = 1) +
annotate("text", x = 14.6, y = rate_average,
label = "OECD\nRate\nAvg",
hjust = 0, vjust = 1.2, size = 5, color = "#aaaaaa", family = "inconsolata", fontface = 1) +
annotate("text", x = 2, y = 20,
label = "less money\n& less time",
hjust = 0.5, vjust = 0, size = 5, color = "#c67e63", family = "inconsolata", fontface = 1) +
annotate("text", x = 9, y = 20,
label = "less money\nbut more time",
hjust = 0.5, vjust = 0, size = 5, color = "#c1a04f", family = "inconsolata", fontface = 1) +
annotate("text", x = 2, y = 90,
label = "more money\nbut less time",
hjust = 0.5, vjust = 0, size = 5, color = "#c1a04f", family = "inconsolata", fontface = 1) +
annotate("text", x = 9, y = 90,
label = "more money\nand more time",
hjust = 0.5, vjust = 0, size = 5, color = "#5b7e47", family = "inconsolata", fontface = 1)
girafe(ggobj = v2, width_svg = 16, height_svg = 12,
options = list(opts_sizing(rescale = TRUE, width = 1.0))
)